﻿//-----------------------------------------------------------------------
// <copyright file="Copyright.cs" author="Michael Herndon">
//     Copyright (c) Company.  All rights reserved.
// </copyright>
//-----------------------------------------------------------------------

namespace Amplify.CodeDom
{
	using System;
	using System.Collections.Generic;
	using System.CodeDom;
	using System.Linq;
	using System.Text;

	using Amplify.CodeDom;

	public static partial class Mixin
	{

		public static CodeCommentStatement Add(this CodeCommentStatementCollection unit, string comments, bool docComment)
		{
			CodeCommentStatement comment = new CodeCommentStatement(comments, docComment);
			unit.Add(comment);
			return comment;
		}

		public static CodeCommentStatement AddDocComment(this CodeCommentStatementCollection unit, string comments)
		{
			CodeCommentStatement comment = new CodeCommentStatement(comments, true);
			unit.Add(comment);
			return comment;
		}

		public static CodeCommentStatement[] ToComments(this IEnumerable<string> comments)
		{
			List<CodeCommentStatement> list = new List<CodeCommentStatement>();
			comments.Each(item => list.Add(new CodeCommentStatement(item, false)));
			return list.ToArray();
		}
	}
}
